import request from '@/utils/request'

//查询单据
export function listBill(data) {
  return request({
    method: "get",
    url: "/rd/order/list",
    params: data
  })
}

// 查询明细
export function listDetail(data) {
  return request({
    method: "get",
    url: "/rd/order/leadInto",
    params: data
  })
}

//字典
export function dictMatching(data) {
  return request({
    url: '/system/dict/data/type/' + data,
    method: 'get',
  })
}


// 查询部门列表
export function listDept(query) {
  return request({
    url: '/system/dept/list',
    method: 'get',
    params: query
  })
}


// 查询人员列表
export function listUser(query) {
  return request({
    url: '/system/user/list',
    method: 'get',
    params: query
  })
}

// 上一条下一条
export function NextBill(query) {
  return request({
    url: '/rd/order/nextOrLast/',
    method: 'get',
    params: query
  })
}

//新增单据
export function addBill(data) {
  return request({
    method: "post",
    url: "/rd/order",
    data: data
  })
}

// 查看单据
export function seeBill(query) {
  return request({
    url: '/rd/order',
    method: 'get',
    params: query
  })
}

// 更新单据
export function updateBill(data) {
  return request({
    method: "put",
    url: "/rd/order",
    data: data
  })
}

// 删除单据
export function deleteBill(data) {
  return request({
    url: '/rd/order/delete',
    method: 'post',
    data: data
  })
}

//审核单据
export function examineBill(data) {
  return request({
    method: "post",
    url: "/rd/order/check",
    data: data
  })
}

//反审核单据
export function examineDeBill(data) {
  return request({
    method: "post",
    url: "/rd/order/antiCheck",
    data: data
  })
}

// 获取单据参数
export function billParameters(query) {
  return request({
    url: '/system/config/form',
    method: 'get',
    params: query
  })
}


//订单号查询
export function listCode(query) {
  return request({
    url: '/om/order/pipe/orderId',
    method: 'get',
    params: query
  })
}

//模块参数
export function moduleParameters(query) {
  return request({
    url: '/system/config/list',
    method: 'get',
    params: query
  })
}


// 查看生产计划单据
export function seePlanBill(query) {
  return request({
    url: '/mp/order',
    method: 'get',
    params: query
  })
}

//查询配方单据
export function listRdCodeBill(data) {
  return request({
    method: "get",
    url: "/rd/ebom/list",
    params: data
  })
}

// 查询配方明细
export function listRdCodeDetail(data) {
  return request({
    method: "get",
    url: "/rd/ebom/getDetail",
    params: data
  })
}

//查询配方单据弄虚有条件
export function listHasRdCodeBill(data) {
  return request({
    method: "get",
    url: "/rd/ebom/list/new",
    params: data
  })
}
